package org.imfuture.pocketzk.core.dao.hibernate;

import net.sourceforge.sannotations.annotation.Bean;
import org.hibernate.Query;
import org.imfuture.pocketzk.core.dao.UserDao;
import org.imfuture.pocketzk.core.model.User;

import java.util.List;

/**
 * Created on: 2007/10/29
 *
 * @author Alan She(scw1109)
 */
@Bean
public class UserDaoHibernate extends GenericDaoHibernate<User> implements UserDao {

    @SuppressWarnings("unchecked")
    public List<User> findByName() {
        Query query = getCurrentSession().createQuery("from User as u where u.name like :name");
        return (List<User>) query.list();
    }
}
